/**
 * outsider.com.cn Inc.
 * Copyright (c) 2011-2022 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import lombok.Getter;

/**
 * @author outsider
 * @version Id: StatusEnum.java, v 0.1 2022/6/1 17:16 outsider Exp $$
 */
@Getter
public enum GoEasyNotificationMessageEnum {
    NOTIFICATION_ORDERS_SHIPPED("NOTIFICATION_ORDERS_SHIPPED", "您购买的宝贝已发货"),

    NOTIFICATION_MERCHANT_ACCEPT_ORDER("NOTIFICATION_MERCHANT_ACCEPT_ORDER", "商家已接单"),

    NOTIFICATION_ORDER_DELIVERY_PROGRESS("NOTIFICATION_ORDER_DELIVERY_PROGRESS", "您的订单正在配送中"),

    NOTIFICATION_ORDER_WAITING_CONFIRM_RECEIPT("NOTIFICATION_ORDER_WAITING_CONFIRM_RECEIPT", "您有一笔订单待确认收货"),

    NOTIFICATION_ORDER_COMPLETED("NOTIFICATION_ORDER_COMPLETED", "您有一笔订单已完成"),

    NOTIFICATION_AFTER_SALE_ORDER_ACCEPT("NOTIFICATION_AFTER_SALE_ORDER_ACCEPT", "您有一笔售后订单已被受理"),

    NOTIFICATION_AFTER_SALE_ORDER_COMPLETED("NOTIFICATION_AFTER_SALE_ORDER_COMPLETED", "您有一笔售后订单已完成"),

    NOTIFICATION_SYSTEM_INFO("NOTIFICATION_SYSTEM_INFO", "系统消息");

    private String code;

    private String message;

    GoEasyNotificationMessageEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getMessageByCode(String code) {
        for(GoEasyNotificationMessageEnum ENUM : GoEasyNotificationMessageEnum.values()) {
            if(ENUM.code.equals(code)) {
                return ENUM.getMessage();
            }
        }
        return "";
    }

    public static Boolean validateNotificationMessage(String code) {
        for(GoEasyNotificationMessageEnum ENUM : GoEasyNotificationMessageEnum.values()) {
            if(ENUM.code.equals(code)) {
                return true;
            }
        }
        return false;
    }
}